package com.oig.base.api;

import com.oig.base.api.factory.CustomsServiceFallBackFactory;
import com.oig.sys.base.dto.CustomsDto;
import com.oig.sys.base.vo.CustomsVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(contextId="customsService",value="sys-base-server",path="/customs",fallbackFactory= CustomsServiceFallBackFactory.class)
public interface CustomsService {


    //@Operation(summary = "根据名称及数据所属组织获取海关")
    @PostMapping(value = "/getByName")
    CustomsVo getByName(@RequestParam("name") String name);

    //@Operation(summary = "根据原code获取海关")
    @PostMapping(value = "/getByOldCode")
    CustomsVo getByOldCode(@RequestParam("oldCode") String oldCode);

    //@Operation(summary = "修改海关")
    @PostMapping(value = "/updateCustoms")
    CustomsVo updateCustoms(@RequestBody CustomsDto customsDto);

    // 根据海关code获取海关
    @PostMapping(value = "/getByCode")
    CustomsVo getByCode(@RequestParam("code") String code);

    // 根据目的港portCode获取海关信息
    @PostMapping(value = "/getByPortCode")
    List<CustomsVo> getByPortCode(@RequestParam("portCode") String portCode);
}
